[% setvar title Interpolation of class method calls %]
<div id="archive-notice">
    <h3>This file is part of the Perl 6 Archive</h3>
    <p>To see what is currently happening visit <a href="http://www.perl6.org/">http://www.perl6.org/</a></p>
</div>
<div class='pod'>
<a name='TITLE'></a><h1>TITLE</h1>
<p>Interpolation of class method calls</p>
<a name='VERSION'></a><h1>VERSION</h1>
<pre>  Maintainer: Michael G Schwern &lt;<a href='mailto:schwern@pobox.com'>schwern@pobox.com</a>&gt;
  Date: 17 Sep 2000
  Mailing List: <a href='mailto:perl6-language-objects@perl.org'>perl6-language-objects@perl.org</a>
  Number: 251
  Version: 1
  Status: Developing</pre>
<a name='ABSTRACT'></a><h1>ABSTRACT</h1>
<p>Class method calls should interpolate in double-quoted strings, and similar
locations.</p>
<pre>    print &quot;There are Dogs-&gt;num_dogs() species of dogs.&quot;;</pre>
<p>would interpolate as:</p>
<pre>    print 'There are '.Dogs-&gt;num_dogs().' species of dogs.';</pre>
<a name='DESCRIPTION'></a><h1>DESCRIPTION</h1>
<p>With the exception of the argument about accessor methods, all the
same arguments for object methods apply to class methods.
Additionally, if scalars, arrays, hashes, subroutines and object
methods interpolate, users may expect class methods to do so.</p>
<p>Class methods require the trailing parenthesis for clarity, same as variable
object methods.  Otherwise, class methods interpolate same as object methods
as RFC 222.</p>
<a name='IMPLEMENTATION'></a><h1>IMPLEMENTATION</h1>
<p>The tokenizer will have to watch for /\s[a-z_]\w*-&gt;/i.  A following
/[A-Z_]\w*\(\)/ indicates a class method call.</p>
<p>Otherwise as RFC 222.</p>
<a name='CAVEATS'></a><h1>CAVEATS</h1>
<p>This RFC is intended to generate discussion about the need and wisdom of
allowing class method interpolation in strings.  Practical examples of code
where this is useful as well as where this would be a hinderance are
requested.  It is presented seperately because I expect much more discussion
than RFC 222 and wish to keep the consideration of the two seperate.</p>
<a name='MIGRATION'></a><h1>MIGRATION</h1>
<p>As RFC 222.</p>
<a name='REFERENCES'></a><h1>REFERENCES</h1>
<p>RFC 222 - Interpolation of object method calls</p>
<p>RFC 237 - Hashes should interpolate in double-quoted strings</p>
<p>Upcoming RFC on interpolation of subroutines</p>
</div>
